//////////////////////////////////////////////////////////////////////
//
// File: BananasSampleScreen.java
//
// Copyright (c) 2005 TiVo Inc.
//
//////////////////////////////////////////////////////////////////////

package com.tivo.hme.samples.bananas;

import com.tivo.hme.bananas.BApplicationPlus;
import com.tivo.hme.bananas.BScreenPlus;
import com.tivo.hme.bananas.BText;

/**
 * This is the super screen class for all of our sample screens.  It handles
 * setting the title and background image
 * 
 * Each Screen needs to have a toString() method that is used to set the title
 *
 * @author Carl Haynes
 */
public class BananasSampleScreen extends BScreenPlus
{
    
    /**
     * Constructor
     */
    public BananasSampleScreen(BApplicationPlus app)
    {
        super(app);

        //
        // set the title of the screen
        //
        int safeTitleH = getBApp().getSafeTitleHorizontal();
        int safeTitleV = getBApp().getSafeTitleVertical();
        BText title = new BText(getNormal(), safeTitleH, safeTitleV, (getWidth()-(safeTitleH*2)), 54);
        title.setValue(this.toString());
        title.setColor(getTitleColor());
        title.setShadow(getTitleShadowColor(), getTitleShadowOffset());
        title.setFlags(RSRC_VALIGN_TOP);
        title.setFont(getTitleFont());
    }
}
